#include<string.h>
#include<unistd.h>
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
using namespace std;

int main(int argc,char *argv[] )
{

   /* extern char **environ;
 int i = 0;
 for(; environ[i]; i++)
 {
     printf("%d: %s\n", i, environ[i]);
 }*/ 

  /*
  if(argc!=2)
  {
    printf("Usage:%s-[a|b|c|d]\n",argv[0]);

    return 0;
  }*/


      if(argc != 2) 
    {
        printf("usage: %s -[a|b|c|d]\n", argv[0]);
        return 0;
    }
    if(strcmp(argv[1], "--help")==0)
    {
        printf("usage: %s -[a|b|c|d]\n", argv[0]);
    }
    else if(strcmp(argv[1], "-a") == 0)
    {
        printf("功能1\n");
    }
    else if(strcmp(argv[1], "-b") == 0)
    {
        printf("功能2\n");
    }
    else if(strcmp(argv[1], "-c") == 0)
    {
        printf("功能3\n");
    }
    else if(strcmp(argv[1], "-d") == 0)
    {
        printf("功能4\n");
    }
    else
    {
        printf("default功能\n");
    }


/*int i=0;
  for(;i<argc;i++)
  {
    printf("argv[%d]->%s\n ",i,argv[i]);
  }*/

 //  printf("who:%s \n",getenv("USER"));
 /* for(int i=0;i<10;i++)
  {
     printf("hello %d\n",i);
  }*/
// printf("PATH:%s\n",getenv("PATH"));

  return 0;
}


